﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

// PlayerStats.cs
// Contains information specific to the current player, such as his party, 
// how far through the game he has progressed, and the current Area 
// he is in.  Also controls loading and saving.
namespace RTS_RPG
{
    public class PlayerStats
    {
        // PlayerStats Fields
        public Texture2D area_representation;
        public Texture2D overworld_representation;
        public List<Character> party;
        public List<Equipment> equipment;
        public List<Item> items;
        public int partOfGame;
        public Area currentArea;
        public RPGGame gameRef;
        public Player_TextureManager textures;

        // Constructor used when starting a new game.
        public PlayerStats(RPGGame gameR, Area starter, ContentManager content)
        {
            // Vector4 stats1 = new Vector4(10, 10, 5, 5);
            // Texture2D image1 = imgs[0];
            // AI ai1 = new AI();
            // List<Ability> ab1 = new List<Ability>();
            // Character main1 = new Character("main1", stats1, 0, image1, ai1, ab1, ab1);
            // party.Add(main1);
            // partOfGame = 0;
            // currentArea = starter;

            textures = new Player_TextureManager();
            textures.LoadContent(content);

            Vector4 stats = new Vector4(3, 0, 16, 0);
            Vector2 hp = new Vector2(30, 30);
            Vector2 mp = new Vector2(20, 20);
            party = new List<Character>();
            for (int i = 0; i < 8; ++i)
                party.Add(new Character("test", hp, mp, new Vector2(Program.NaN, Program.NaN), 
                    1, 5, stats, 0, textures.unit_default_avatar,
                    textures.battle_sprite, null, null, null, null));
            equipment = new List<Equipment>();
            items = new List<Item>();
            area_representation = textures.area_sprite;
            overworld_representation = textures.overworld_sprite;
            partOfGame = 0;
            currentArea = starter;
            gameRef = gameR;
        }

        // A Constructor used for Loading a saved game.
        public PlayerStats(List<Texture2D> imgs, int filenum)
        {
        }


        // Saves the game stats to a file.  A constructor is used for loading.
        public void save(int filenum)
        {
        }
    }
}
